package com.example.roomwordsample.repository

import com.example.roomwordsample.dao.WordDao
import com.example.roomwordsample.model.Word
import kotlinx.coroutines.flow.Flow

class WordRepository(private val wordDao: WordDao) {

    val allWords : Flow<List<Word>> = wordDao.getWords();


    suspend fun insert(word: Word) {
        wordDao.insert(word = word)
    }

    fun deleteById(id: Int) {
        wordDao.deleteById(id)
    }
}